package com.bwie.es;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * @author : xiaogao
 * @date : 2024-11-21 14:06
 * @description :
 **/
@Data
@Document(indexName = "es_user",shards = 1,replicas = 0)
public class EsUser implements Serializable {
    @Id
    @Field(type = FieldType.Keyword)
    private Integer userId;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String userName;
    @Field(type = FieldType.Text)
    private String userPass;
    @Field(type = FieldType.Text)
    private String nickName;
    @Field(type = FieldType.Text)
    private String userMobile;
    @Field(type = FieldType.Text)
    private String userEmail;
    @Field(type = FieldType.Integer)
    private Integer userRole;
    @Field(type = FieldType.Integer)
    private Integer userAvatar;

    @Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8",shape = JsonFormat.Shape.STRING)
    private Date createTime;

}